/**
 * (c) 2009 Shanghai Schick Information Technologies Co., Ltd.
 * 
 * http://www.schickit.com
 */
package me.cloudcat.develop.entity.configuration;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import me.cloudcat.develop.Constant;
import me.cloudcat.develop.entity.BaseEntity;

/**
 * 人员
 * @author ZZWang
 * @Time 2017年1月17日  下午2:55:01
 *
 */
@Entity
@Table(name = "tbl_person", uniqueConstraints = { @UniqueConstraint(columnNames = "no") })
//@SequenceGenerator(name = "SEQ_STORE", sequenceName = "TBL_PERSON_ID_ASQ", allocationSize = 1)
public class Person extends BaseEntity<Person> {

	private static final long serialVersionUID = -6395845029909268781L;

	/**
	 * 性别
	 */
	private String gender = Constant.MALE;

	/**
	 * 名称
	 */
	@NotNull
	@Length(max = 30)
	private String name;

	/**
	 * 工号
	 */
	@Length(max = 20)
	@Column(name = "no")
	private String number;
	/**
	 * 职务
	 */
	private String title;
	/**
	 * 学科
	 */
	private String subject;
	/**
	 * 邮箱
	 */
	private String email;
	/**
	 * 手机号码
	 */
	private String phoneNumber;
	/**
	 * 短号
	 */
	private String shortNumber;
	/**
	 * 办公号码
	 */
	private String officeNumber;
	/**
	 * 办公房间
	 */
	private String officeRoom;
	/**
	 * 所属部门
	 */
	@ManyToOne(fetch = FetchType.EAGER)
	private Department department;
	/**
	 * 离职
	 */
	private Integer dimission = 0;
	/**
	 * 版本号
	 */
	@Version
	private int version;
	/**
	 * Image for the person
	 */
	private String headImage;

	/*--------------------------------------------
	|         C O N S T R U C T O R S           |
	============================================*/
	// 调度代码
	private String code;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Person() {
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getShortNumber() {
		return shortNumber;
	}

	public void setShortNumber(String shortNumber) {
		this.shortNumber = shortNumber;
	}

	public String getOfficeNumber() {
		return officeNumber;
	}

	public void setOfficeNumber(String officeNumber) {
		this.officeNumber = officeNumber;
	}

	public String getOfficeRoom() {
		return officeRoom;
	}

	public void setOfficeRoom(String officeRoom) {
		this.officeRoom = officeRoom;
	}

	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	public Integer isDimission() {
		return dimission;
	}

	public void setDimission(Integer dimission) {
		this.dimission = dimission;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public String getHeadImage() {
		return headImage;
	}

	public void setHeadImage(String headImage) {
		this.headImage = headImage;
	}
}